# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.MyBusinessAccountManagement.V1.Model.Admin do
  @moduledoc """
  An administrator of an Account or a location.

  ## Attributes

  *   `account` (*type:* `String.t`, *default:* `nil`) - Immutable. The name of the Account resource that this Admin refers to. Used when calling locations.admins.create to invite a LocationGroup as an admin. If both this field and `admin` are set on `CREATE` requests, this field takes precedence and the email address in `admin` will be ignored. Format: `accounts/{account}`.
  *   `admin` (*type:* `String.t`, *default:* `nil`) - Optional. The name of the admin. When making the initial invitation, this is the invitee's email address. On `GET` calls, the user's email address is returned if the invitation is still pending. Otherwise, it contains the user's first and last names. This field is only needed to be set during admin creation.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Immutable. The resource name. For account admins, this is in the form: `accounts/{account_id}/admins/{admin_id}` For location admins, this is in the form: `locations/{location_id}/admins/{admin_id}` This field will be ignored if set during admin creation.
  *   `pendingInvitation` (*type:* `boolean()`, *default:* `nil`) - Output only. Indicates whether this admin has a pending invitation for the specified resource.
  *   `role` (*type:* `String.t`, *default:* `nil`) - Required. Specifies the role that this admin uses with the specified Account or Location.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :account => String.t() | nil,
          :admin => String.t() | nil,
          :name => String.t() | nil,
          :pendingInvitation => boolean() | nil,
          :role => String.t() | nil
        }

  field(:account)
  field(:admin)
  field(:name)
  field(:pendingInvitation)
  field(:role)
end

defimpl Poison.Decoder, for: GoogleApi.MyBusinessAccountManagement.V1.Model.Admin do
  def decode(value, options) do
    GoogleApi.MyBusinessAccountManagement.V1.Model.Admin.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.MyBusinessAccountManagement.V1.Model.Admin do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
